<?php

$file_name = "data/films.txt";
$file_path = realpath($file_name);
$films = array();
$file = fopen($file_path, "r");
//var_dump($file)
//$data=  fgets($file);
//var_dump($data);
while (!feof($file)) {
    $films[] = trim(fgets($file));
    //var_dump($files);
}
fclose($file);
?>
<?php foreach ($films as $line):
    //../ptnhuan-web1/?>
    <?php if (!empty($line)) : ?>
        <?php $films = explode(";", $line); ?>
<img src ="../ptnhuan-web1/public/images/films/<?php echo $films[1]?>">
<?php echo $films[2]?>"><br>
    <?php endif; ?>
<?php endforeach; ?>

    